package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-07-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_account")
public class GuAccount extends Model<GuAccount> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "account_id", type = IdType.AUTO)
    private Integer accountId;

    /**
     * 账号
     */
    @NotEmpty(message = "账号信息不能为空")
    private String accountNumber;

    /**
     * 密码
     */
    @NotEmpty(message = "密码不能为空")
    private String accountPassword;

    /**
     * steamId
     */
    @NotEmpty(message = "steamId不能为空")
    private String accountSteamId;

    /**
     * 移动令牌秘钥
     */
    @NotEmpty(message = "移动令牌秘钥不能为空")
    private String accountSharedSecret;

    /**
     * 报价确认密钥
     */
    @NotEmpty(message = "报价确认秘钥不能为空")
    private String accountIdentitySecret;

    /**
     * 0 禁用 1 启用
     */
    private Integer accountState;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime accountUpdateTime;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime accountCreateTime;


    @Override
    protected Serializable pkVal() {
        return this.accountId;
    }

}
